//
//  FoosDatilCell.m
//  HealthA段
//
//  Created by MrJXT on 15/6/4.
//  Copyright (c) 2015年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "FoosDatilCell.h"
#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
@implementation FoosDatilCell
- (void)dealloc
{
    [_tagLabel release];
    [_foodLabel release];
    [_methLabel release];
    [_picView release];
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.picView = [[UIImageView alloc]init];
        [self.contentView addSubview:self.picView];
        [_picView release];
        
        self.tagLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.tagLabel];
        [_tagLabel release];
                
        self.foodLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.foodLabel];
        [_foodLabel release];
        
        self.methLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.methLabel];
        [_methLabel release];
    }
    return self;
}
//试图布局
-(void)layoutSubviews
{
    [super layoutSubviews];
    self.picView.frame = CGRectMake(5, 5, WIDTH - 10,HEIGHT );
    
    self.tagLabel.frame = CGRectMake(5, HEIGHT / 4 +15, WIDTH , 40);
//    self.tagLabel.numberOfLines = 0;
//    [self.tagLabel sizeToFit];
    
    self.foodLabel.frame = CGRectMake(5, HEIGHT / 4 + 75, WIDTH , 40);
//    self.foodLabel.numberOfLines = 0;
//    [self.foodLabel sizeToFit];
    
    self.methLabel.frame = CGRectMake(5, HEIGHT / 4 + 115, WIDTH , HEIGHT - 65);
    self.methLabel.numberOfLines = 0;
    [self.methLabel sizeToFit];
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
